Carbon


NavChooseObject

Header: Navigation.h Carbon status: Supported

Displays a dialog box that prompts the user to choose a file, folder, or volume.

OSErr NavChooseObject (
    AEDesc *defaultLocation, 
    NavReplyRecord *reply, 
    NavDialogOptions *dialogOptions, 
    NavEventUPP eventProc, 
    NavObjectFilterUPP filterProc, 
    void *callBackUD
);
defaultLocation

A pointer to an Apple event descriptor structure (AEDesc). Before calling NavChooseObject, you can set up a structure of AEDesc type 'typeFSS' to specify a default location to be viewed. If you pass NULL in this parameter, Navigation Services displays the last location visited during a call to the NavChooseObject function. If the file system specification in the AEDesc structure does not describe a directory or volume, Navigation Services uses the desktop as the default location.

reply

A pointer to a structure of type NavReplyRecord. Upon return, Navigation Services uses this structure to provide data to your application about the results of your NavChooseObject call.

dialogOptions

A pointer to a structure of type NavDialogOptions. Before calling NavChooseObject, set up this structure to specify dialog box settings. If you do not provide this structure, Navigation Services uses the defaults for all options. See “Dialog Option Configuration Constants” for a description of the default settings.

eventProc

A Universal Procedure Pointer (UPP) of type NavEventProcPtr that points to your application-defined event-handling function. You obtain this UPP by calling the macro NewNavEventProc. Implementing an event-handling function allows your application to update windows after the user moves or resizes the dialog box. If you pass NULL in this parameter, the dialog box is not movable or resizable. For more information, see “Handling Events”.

filterProc

A Universal Procedure Pointer (UPP) of type NavObjectFilterProcPtr that points to your application-defined filter function. Obtain this UPP by calling the macro NewNavObjectFilterProc. An application-defined filter function determines if a volume, directory, or file should be displayed in the browser list or pop-up menus. For more information, see “Filtering File Objects”.

callBackUD

A pointer to a value set by your application. When the NavChooseObject function calls your event-handling function, the callBackUD value is passed back to your application.

function result

A result code.

DISCUSSION

This function is useful when you need to display a dialog box that prompts the user to choose a file object that might be a file, folder, or volume. If you want the user to choose a specific type of file object, you should use the function designed for that type of object; to select a file, for example, use the function NavChooseFile.

VERSION NOTES

Available in Navigation Services 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when NavigationLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by NavigationLib 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/17/2000)